namespace BM.Tools.WebControls.MForm.Navigation.XPath.Predicates
{    
    using System.Collections.ObjectModel;

    /// <summary>
    /// A definition of a predicte that contains other predicates inside
    /// </summary>
    public abstract class ComplexPredicate : Predicate
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComplexPredicate"/> class. 
        /// </summary>
        /// <param name="predicates">
        /// The predicates.
        /// </param>
        protected ComplexPredicate(params Predicate[] predicates)
        {
            Contents = new Collection<Predicate>(predicates);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ComplexPredicate"/> class. 
        /// </summary>
        /// <param name="texts">
        /// The texts.
        /// </param>
        protected ComplexPredicate(params string[] texts)
        {
            Contents = new Collection<Predicate>();
            foreach (string text in texts)
            {
                Contents.Add(Create(text));
            }
        }

        /// <summary>
        /// Gets Contents.
        /// </summary>
        /// <value>
        /// The contents.
        /// </value>
        public Collection<Predicate> Contents
        {
            get;
            private set;
        }
    }
}